<template>
  <div>
    <div class="dy_name">
      <!-- 性别页面布局开始 -->
      <div class="dy_head">
        <!-- tou -->
        <van-icon name="arrow-left" @click="go"/>
        <p>修改个人信息</p>
        <p @click="cun">保存</p>
        <!-- tou -->
      </div>
      <div class="dy_con">
        <input type="text" v-model="nickname" class="aa" />
      </div>
    </div>
  </div>
</template>

<script>
import {user} from '../../request/http'
export default {
  name: "",
  data() {
    return {
      nickname: ""
    };
  },
  props: [],
  components: {},
  mounted() {
    console.log(this.$route.query.name);
    this.nickname = this.$route.query.name;
  },
  methods: {
      go(){
          this.$router.go(-1)
      },
      cun(){
          user({nickname:this.nickname}).then(res=>{
            //   console.log(res)
            this.$toast("修改成功")
            this.$router.go(-1)
          })
      }
  }
};
</script>

<style scoped>
.dy_name{
    width: 100%;
    height: 100%;
    font-size: 16px;
    line-height: 20px;
}
.dy_head{
    height: 50px;
    display: flex;
    background: #fff;
    align-items: center;
    padding: 0 10px;
}
.dy_head>p:nth-of-type(1){
    height: auto;
    width: 290px;
    text-align: center;
}
input{
    width: 100%;
    height: 40px;
    font-size: 16px;
    border: none;
    margin-top: 10px;
    box-sizing: border-box;
    padding-left: 10px;
}
</style>